using Roslyn.Compilers.CSharp;

namespace BITS.PreCompiler.CSharp.Syntax.Extensions
{
    /// <summary>
    /// Extension methods for class nodes
    /// </summary>
    public static partial class ClassExtension
    {
        /// <summary>
        /// Synthesizes on basis of current class node an partial class.
        /// </summary>
        /// <param name="classNode">The class node.</param>
        /// <returns></returns>
        public static ClassDeclarationSyntax SynthesizePartialClass(this ClassDeclarationSyntax classNode)
        {
            return Roslyn.Compilers.CSharp.Syntax.ClassDeclaration(
                modifiers:         classNode.Modifiers,
                identifier:        classNode.Identifier,
                typeParameterList: classNode.TypeParameterList, 
                constraintClauses: classNode.ConstraintClauses,
                semicolonToken:    classNode.SemicolonToken, 
                attributeLists:    classNode.AttributeLists, 
                keyword:           classNode.Keyword,
                baseList:          classNode.BaseList, 
                openBraceToken:    classNode.OpenBraceToken, 
                members:           classNode.Members,
                closeBraceToken:   classNode.CloseBraceToken);
        }
    }
}